import request from "./request";

export function RegisterApi(params) {
  return request.post("/register", params);
}
export function LoginApi(params) {
  return request.post("/login", params);
}
export function ListApi(params) {
  return request.get("/article", { params });
}

export function AddArticle(params) {
  return request.post("/article/add", params);
}
export function RemoveArticle(id) {
  return request.post("/article/remove", id);
}

export function EditArticle(params) {
  return request.put("/article/update", params);
}
export function ReadArticle(params) {
  return request.get("/article/" + params.id);
}

export function EditUser(params) {
  return request.put("/info", params);
}

export function UploadAvatar(params) {
  return request.post("/upload", params);
}
// export const ReadArticle = (params) => request.get(`/article/${params.id}`);
// export const RegisterApi = (params) => request.post("/register", params);
